From 57a18b8f93b155396060a4828e61cd063a9e54ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Thu, 17 Nov 2016 13:09:54 +0100 Subject: [PATCH] extensions/gggl-lies: bump up accuracy of a conversion --- extensions/gggl-lies.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extensions/gggl-lies.c b/extensions/gggl-lies.c index 22d0fee..5d50f5b 100644 --- a/extensions/gggl-lies.c +++ b/extensions/gggl-lies.c @@ -46,8 +46,6 @@ * need this piece of code for projects where GPL compatibility * was a must. * - * TODO: error diffusion, - * gamma correction (not really,. gamma correction belongs in seperate ops,. */ static long @@ -635,7 +633,7 @@ conv_rgbA8_rgba8 (unsigned char *src, unsigned char *dst, long samples) } else { - unsigned int aa = ((255 << 16) + (src[3] >> 1)) / src[3]; + unsigned int aa = ((255 << 16) - 255) / src[3]; *dst++ = (src[0] * aa + 0x8000) >> 16; *dst++ = (src[1] * aa + 0x8000) >> 16; *dst++ = (src[2] * aa + 0x8000) >> 16; -- 2.30.2